package ShapeDemo;

abstract class Shape {
    public abstract void draw();
 }
 class Flower extends Shape {

     @Override
     public void draw() {
         System.out.println("画❀");
     }
 }
 class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形");
    }
 }
 class Cycle extends Shape {
     @Override
     public void draw() {
         System.out.println("画圆圈");
     }
 }

public class Test {
    public static void func(Shape shape) {
        shape.draw();
    }
     public static void main(String[] args) {
            func(new Flower());
            func(new Cycle());
            func(new Rect());

     }
 }